<?php

/**
 * Created by PhpStorm.
 * User: evan
 * Date: 16/9/20
 * Time: 下午12:42
 */
class Center extends MY_Api_Controller
{
    /**
     * 我发起的竞拍
     */
    public function my()
    {
        $uid = $this->uid;
        $page  = (int)$this->input->get_post('page');
        $limit = (int)$this->input->get_post('limit');


        $this->load->service('auction/service_auction_center');
        $data = $this->service_auction_center->my($uid, $page, $limit);


        foreach ($data['data'] as $k => $v)
        {
            //unset($data['data'][$k]['cid']);
            //unset($data['data'][$k]['handshake_status']);
            //unset($data['data'][$k]['ds_status']);
            unset($data['data'][$k]['view_num']);
            unset($data['data'][$k]['like_num']);
            unset($data['data'][$k]['focus_num']);
            unset($data['data'][$k]['win_uid']);
            unset($data['data'][$k]['win_uname']);
            unset($data['data'][$k]['win_time']);
            unset($data['data'][$k]['win_amount']);
            unset($data['data'][$k]['create_time']);
        }


        $this->json_output($data['data'], $data['status']);
    }


    /**
     * 我参与的竞拍
     */
    public function partake()
    {
        $uid = $this->uid;
        $page  = (int)$this->input->get_post('page');
        $limit = (int)$this->input->get_post('limit');


        $this->load->service('auction/service_auction_center');
        $data = $this->service_auction_center->partake($uid, $page, $limit);


        foreach ($data['data'] as $k => $v)
        {
            //unset($data['data'][$k]['cid']);
            //unset($data['data'][$k]['handshake_status']);
            //unset($data['data'][$k]['ds_status']);
            unset($data['data'][$k]['view_num']);
            unset($data['data'][$k]['like_num']);
            unset($data['data'][$k]['focus_num']);
            //unset($data['data'][$k]['win_uid']);
            //unset($data['data'][$k]['win_uname']);
            //unset($data['data'][$k]['win_time']);
            //unset($data['data'][$k]['win_amount']);
            unset($data['data'][$k]['create_time']);
        }


        $this->json_output($data['data'], $data['status']);
    }
}